package com.ydc.ln.tutorial.gui;

import javax.swing.JFrame;

/**
 * 
 * @author ydc
 * @date 下午1:33:47 2013-5-19
 */
public abstract class MyJFrame extends JFrame {

    /**
     * @Fields serialVersionUID
     */
    private static final long serialVersionUID = -3868224883071039992L;

    private int defaultWidth = 800;
    private int defaultHeight = 600;

    public MyJFrame() {
        this.setTitle("Menu Test");
        this.setSize(defaultWidth, defaultHeight);
        this.setResizable(false);
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

        initComp();

        // this.pack();
        this.setVisible(true);
    }

    public abstract void initComp();

    public int getDefaultWidth() {
        return defaultWidth;
    }

    public void setDefaultWidth(int defaultWidth) {
        this.defaultWidth = defaultWidth;
    }

    public int getDefaultHeight() {
        return defaultHeight;
    }

    public void setDefaultHeight(int defaultHeight) {
        this.defaultHeight = defaultHeight;
    }
}
